home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
utils
/
gemfut15.lzh
/
AESUTRS2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-26
|
2KB
|
61 lines
/**************************************************************************
*
* AESFAST PD utilties.
*
* Resource-related utilities 2...
* rsc_gstrings
*
* 05/26/90 - v1.4
* > Coded a C version of this routine.
* > Added support for ICONs.
*************************************************************************/
#include <gemfast.h>
/*-------------------------------------------------------------------------
* rsc_gstrings - Get string pointers within rsc tree.
*
* Will this work with MWC? Good question, it depends on how MWC puts
* parms on the stack...
*-----------------------------------------------------------------------*/
typedef struct {
int object;
long *stringptr;
} OBJSTR;
void
rsc_gstrings(ptree, parms)
register OBJECT *ptree;
OBJSTR parms[];
{
register OBJECT *pobj;
register OBJSTR *pparms;
register long *pspec;
for (pparms = parms; pparms->object >= 0; pparms++) {
pobj = &ptree[pparms->object];
pspec = &(pobj->ob_spec);
if (pobj->ob_flags & INDIRECT) {
pspec = (long *)*pspec;
}
switch (pobj->ob_type & 0x00FF) {
case G_ICON:
pspec = (long *)*pspec;
pspec = &pspec[2]; /* add 12-byte offset to pointer */
break;
case G_TEXT:
case G_BOXTEXT:
case G_FTEXT:
case G_FBOXTEXT:
pspec = (long *)*pspec;
break;
}
*(pparms->stringptr) = *pspec;
}
}